package com.jiamao.goplay.util;

import com.netease.nim.uikit.common.util.sys.TimeUtil;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import me.goldze.mvvmhabit.utils.KLog;

public class TimeUtils  {


    public static String getTime(Date date) {//可根据需要自行截取数据显示

        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        return format.format(date);

       // TimeUtil.getDateTimeString()
    }


    public static  String getAstro(Date date) {


        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        int day = calendar.get(Calendar.DAY_OF_MONTH);
        int month = calendar.get(Calendar.MONTH)+1;
        KLog.d("month:"+month +" day:"+day);
        String xingzuo = "";
        switch (month) {
     case 1:
                xingzuo = day<21?"摩羯座":"水瓶座";
                break;
                case 2:
                xingzuo = day<20? "水瓶座":"双鱼座";
                break;
    case 3:
                xingzuo = day<21?"双鱼座":"白羊座";
                break;
     case 4:
                xingzuo = day<21?"白羊座":"金牛座";
                break;
            case 5:
                xingzuo = day<22?"金牛座":"双子座";
                break;
                case 6:
                xingzuo = day<22?"双子座":"巨蟹座";
                break;
    case 7:
                xingzuo = day<23?"巨蟹座":"狮子座";
                break;
                case 8:
                xingzuo = day<24?"狮子座":"处女座";
                break;
                case 9:
                xingzuo = day<24?"处女座":"天秤座";
                break;
    case 10:
                xingzuo = day<24?"天秤座":"天蝎座";
                break;
                case 11:
                xingzuo = day<23?"天蝎座":"射手座";
                break;
                case 12:
                xingzuo = day<22?"射手座":"摩羯座";
                break;
        }
        return xingzuo;
    }
}
